package cn.ac.cintcm.dataconverge.researcher.service.impl;

import java.util.List;

import com.hs.core.page.PageParam;
import com.hs.core.page.PageUtil;
import com.hs.core.service.BaseSevice;

import cn.ac.cintcm.dataconverge.dao.IBaseDao;
import cn.ac.cintcm.dataconverge.researcher.dao.IDepartmentDao;
import cn.ac.cintcm.dataconverge.researcher.dao.IOrgDao;
import cn.ac.cintcm.dataconverge.researcher.domain.Organization;
import cn.ac.cintcm.dataconverge.researcher.service.IOrgService;

public class OrgService extends BaseSevice implements IOrgService{

	private IOrgDao orgDao;
	private IDepartmentDao departmentDao;
	
	public IOrgDao getOrgDao() {
		return orgDao;
	}

	public void setOrgDao(IOrgDao orgDao) {
		this.orgDao = orgDao;
	}

	public List listOrgs(){
		return orgDao.listOrgs();
	}
	
	public PageUtil listOrgsPage(PageParam pageParam) {
		// TODO Auto-generated method stub
		return orgDao.listOrgsPage(pageParam);
	}
	
	public Organization getOrgById(Long id) {
		return orgDao.getOrgById(id);
	}

	public boolean saveOrg(Organization org) {
		// TODO Auto-generated method stub
		System.out.println("in the service saveorg!");
		orgDao.saveObject(org);
		return true;
	}

	public boolean deleteOrg(Long id) {
		// TODO Auto-generated method stub
		return orgDao.deleteOrg(orgDao.getOrgById(id));
	}

	public List getAllKeySubjects() {
		// TODO Auto-generated method stub
		return orgDao.getAllKeySubjects();
	}

	@Override
	public IBaseDao getBaseDao() {
		// TODO Auto-generated method stub
		return departmentDao;
	}

	

}
